package com.million.artservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.million.artservice.entity.Article;
import com.baomidou.mybatisplus.extension.service.IService;
import com.million.artservice.entity.vo.AddArticleVoInfo;
import com.million.artservice.entity.vo.ArticleVo;
import com.million.artservice.entity.vo.QueryArticleVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章 服务类
 * </p>
 *
 * @author 十麓
 * @since 2022-04-17
 */
public interface ArticleService extends IService<Article> {

    //分页查询文章列表 返回Article 列表
    Map<String, Object> queryArticlePage (Page<Article> articlePage);

    //查询最热文章 前8条
    List<Article> queryEightHotArticle ();


    //根据文章id 获取文章详情 编写sql
    ArticleVo queryArticleById (String articleId);

    //================================================================

    //后台管理 文章管理 条件分页查询文章
    Page<ArticleVo> queryArticlePageConditions (Page<ArticleVo> articlePage, QueryArticleVo queryArticleVo);

    //添加文章 返回文章Id
    String addArticleInfo (AddArticleVoInfo addArticleVoInfo);

    //根据文章Id 得到文章内容
    AddArticleVoInfo getArticleInfo (String articleId);

    //修改文章内容
    void updateArticleInfo (AddArticleVoInfo addArticleVoInfo);

    //根据文章id 删除文章信息
    void deleteArticleInfo (String articleId);
}
